package de.yvert.jingle.impl.openexr;

import java.io.IOException;

public class CompressionAttribute extends Attribute
{

public static final String TYPE = "compression";
public static final int SIZE = 1;

private final CompressionType type;

public CompressionAttribute(String name, CompressionType type)
{
	super(name);
	this.type = type;
}

public CompressionType getType()
{ return type; }

@Override
public String toString()
{ return "compression \""+getName()+"\" = "+type; }

@Override
public void write(ExrOutputStream out) throws IOException
{
	out.writeString(getName());
	out.writeString(TYPE);
	out.writeInt(SIZE);
	out.writeByte(type.getCode());
}

}
